import type { DataTableColumns } from 'naive-ui'

const codeStore = useCodeStore()

export const basicColumns: DataTableColumns<BaseUserPO> = [
  IdColumn,
  {
    key: 'username',
    title: '账号',
    width: 100
  },
  {
    key: 'nickname',
    title: '昵称',
    width: 80
  },
  {
    key: 'gender',
    title: '性别',
    width: 50,
    render(row) {
      return renderTag(codeStore.getName(_Dict.Gender, row.gender))
    }
  },
  {
    key: 'status',
    title: '状态',
    width: 80,
    render(row) {
      const type = row.status == _Status.Enabled ? _NTagType.Success : _NTagType.Error
      return renderTag(codeStore.getName(_Dict.Status, row.status), type)
    }
  },
  ...BaseColumns
]
